<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/usertemplate.xhtml">
        <ui:define name="title">
            <h:outputText value="List Course"></h:outputText>
        </ui:define>
        <ui:define name="leftcontent">
            <h:form>
                <h:panelGroup rendered="#{courseController.items.rowCount > 0}">
                <div class="pad_left1">
                    <h2 class="pad_bot1">Academic Course</h2>
                </div>
                <h:dataTable value="#{courseController.items}" var="item" class="wrapper pad_bot2">
                    <h:column>
                        <figure class="left marg_right1"><img src="../../resources/img/page3_img1.jpg" alt=""/></figure>
                    </h:column>
                    <h:column>
                        <p class="pad_bot1 pad_top2"><strong><h:outputText value="#{item.courseName}"/></strong> <br/>
                            #{item.courseContent}
                        </p>
                        <h:commandLink action="#{courseController.prepareViewToUser}" class="button marg_left1">
                            <span><span>Read More</span></span>
                        </h:commandLink>
                    </h:column>
                </h:dataTable>
                </h:panelGroup>
            </h:form>
        </ui:define>
        <ui:define name="rightcontent">
            <h:form>
                <div class="pad_left1">
                    <h2>New Course</h2>
                </div>
                <h:dataTable value="#{courseController.showTop3CourseByUser()}" var="item" class="list1">
                    <h:column>
                        <h:commandLink value="#{item.courseName}" action="#{courseController.prepareViewToUser}">
                        </h:commandLink>
                    </h:column>
                </h:dataTable>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
